

<!DOCTYPE html>
<html class="writer-html5" lang="en" >
<head>
  <meta charset="utf-8" />
  
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  
  <title>mindspore.dataset.vision &mdash; MindSpore master documentation</title>
  

  
  <link rel="stylesheet" href="../_static/css/theme.css" type="text/css" />
  <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />

  
  

  
  

  

  
  <!--[if lt IE 9]>
    <script src="../_static/js/html5shiv.min.js"></script>
  <![endif]-->
  
    
      <script type="text/javascript" id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script>
        <script src="../_static/jquery.js"></script>
        <script src="../_static/underscore.js"></script>
        <script src="../_static/doctools.js"></script>
        <script src="../_static/language_data.js"></script>
        <script async="async" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/latest.js?config=TeX-AMS-MML_HTMLorMML"></script>
    
    <script type="text/javascript" src="../_static/js/theme.js"></script>

    
    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" />
    <link rel="next" title="mindspore.dataset.vision.c_transforms.AutoContrast" href="dataset_vision/mindspore.dataset.vision.c_transforms.AutoContrast.html" />
    <link rel="prev" title="mindspore.dataset.transforms.py_transforms.RandomOrder" href="dataset_transforms/mindspore.dataset.transforms.py_transforms.RandomOrder.html" /> 
</head>

<body class="wy-body-for-nav">

   
  <div class="wy-grid-for-nav">
    
    <nav data-toggle="wy-nav-shift" class="wy-nav-side">
      <div class="wy-side-scroll">
        <div class="wy-side-nav-search" >
          

          
            <a href="../index.html" class="icon icon-home"> MindSpore
          

          
          </a>

          
            
            
          

          
<div role="search">
  <form id="rtd-search-form" class="wy-form" action="../search.html" method="get">
    <input type="text" name="q" placeholder="Search docs" />
    <input type="hidden" name="check_keywords" value="yes" />
    <input type="hidden" name="area" value="default" />
  </form>
</div>

          
        </div>

        
        <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
          
            
            
              
            
            
              <p class="caption"><span class="caption-text">MindSpore Python API</span></p>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="mindspore.html">mindspore</a></li>
<li class="toctree-l1"><a class="reference internal" href="mindspore.common.initializer.html">mindspore.common.initializer</a></li>
<li class="toctree-l1"><a class="reference internal" href="mindspore.communication.html">mindspore.communication</a></li>
<li class="toctree-l1"><a class="reference internal" href="mindspore.compression.html">mindspore.compression</a></li>
<li class="toctree-l1"><a class="reference internal" href="mindspore.context.html">mindspore.context</a></li>
<li class="toctree-l1"><a class="reference internal" href="mindspore.dataset.html">mindspore.dataset</a></li>
<li class="toctree-l1"><a class="reference internal" href="mindspore.dataset.audio.html">mindspore.dataset.audio</a></li>
<li class="toctree-l1"><a class="reference internal" href="mindspore.dataset.config.html">mindspore.dataset.config</a></li>
<li class="toctree-l1"><a class="reference internal" href="mindspore.dataset.text.html">mindspore.dataset.text</a></li>
<li class="toctree-l1"><a class="reference internal" href="mindspore.dataset.transforms.html">mindspore.dataset.transforms</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">mindspore.dataset.vision</a><ul>
<li class="toctree-l2"><a class="reference internal" href="#mindspore-dataset-vision-c-transforms">mindspore.dataset.vision.c_transforms</a><ul>
<li class="toctree-l3"><a class="reference internal" href="dataset_vision/mindspore.dataset.vision.c_transforms.AutoContrast.html">mindspore.dataset.vision.c_transforms.AutoContrast</a></li>
<li class="toctree-l3"><a class="reference internal" href="dataset_vision/mindspore.dataset.vision.c_transforms.BoundingBoxAugment.html">mindspore.dataset.vision.c_transforms.BoundingBoxAugment</a></li>
<li class="toctree-l3"><a class="reference internal" href="dataset_vision/mindspore.dataset.vision.c_transforms.CenterCrop.html">mindspore.dataset.vision.c_transforms.CenterCrop</a></li>
<li class="toctree-l3"><a class="reference internal" href="dataset_vision/mindspore.dataset.vision.c_transforms.ConvertColor.html">mindspore.dataset.vision.c_transforms.ConvertColor</a></li>
<li class="toctree-l3"><a class="reference internal" href="dataset_vision/mindspore.dataset.vision.c_transforms.Crop.html">mindspore.dataset.vision.c_transforms.Crop</a></li>
<li class="toctree-l3"><a class="reference internal" href="dataset_vision/mindspore.dataset.vision.c_transforms.CutMixBatch.html">mindspore.dataset.vision.c_transforms.CutMixBatch</a></li>
<li class="toctree-l3"><a class="reference internal" href="dataset_vision/mindspore.dataset.vision.c_transforms.CutOut.html">mindspore.dataset.vision.c_transforms.CutOut</a></li>
<li class="toctree-l3"><a class="reference internal" href="dataset_vision/mindspore.dataset.vision.c_transforms.Decode.html">mindspore.dataset.vision.c_transforms.Decode</a></li>
<li class="toctree-l3"><a class="reference internal" href="dataset_vision/mindspore.dataset.vision.c_transforms.Equalize.html">mindspore.dataset.vision.c_transforms.Equalize</a></li>
<li class="toctree-l3"><a class="reference internal" href="dataset_vision/mindspore.dataset.vision.c_transforms.GaussianBlur.html">mindspore.dataset.vision.c_transforms.GaussianBlur</a></li>
<li class="toctree-l3"><a class="reference internal" href="dataset_vision/mindspore.dataset.vision.c_transforms.HorizontalFlip.html">mindspore.dataset.vision.c_transforms.HorizontalFlip</a></li>
<li class="toctree-l3"><a class="reference internal" href="dataset_vision/mindspore.dataset.vision.c_transforms.HWC2CHW.html">mindspore.dataset.vision.c_transforms.HWC2CHW</a></li>
<li class="toctree-l3"><a class="reference internal" href="dataset_vision/mindspore.dataset.vision.c_transforms.Invert.html">mindspore.dataset.vision.c_transforms.Invert</a></li>
<li class="toctree-l3"><a class="reference internal" href="dataset_vision/mindspore.dataset.vision.c_transforms.MixUpBatch.html">mindspore.dataset.vision.c_transforms.MixUpBatch</a></li>
<li class="toctree-l3"><a class="reference internal" href="dataset_vision/mindspore.dataset.vision.c_transforms.Normalize.html">mindspore.dataset.vision.c_transforms.Normalize</a></li>
<li class="toctree-l3"><a class="reference internal" href="dataset_vision/mindspore.dataset.vision.c_transforms.NormalizePad.html">mindspore.dataset.vision.c_transforms.NormalizePad</a></li>
<li class="toctree-l3"><a class="reference internal" href="dataset_vision/mindspore.dataset.vision.c_transforms.Pad.html">mindspore.dataset.vision.c_transforms.Pad</a></li>
<li class="toctree-l3"><a class="reference internal" href="dataset_vision/mindspore.dataset.vision.c_transforms.RandomAffine.html">mindspore.dataset.vision.c_transforms.RandomAffine</a></li>
<li class="toctree-l3"><a class="reference internal" href="dataset_vision/mindspore.dataset.vision.c_transforms.RandomColor.html">mindspore.dataset.vision.c_transforms.RandomColor</a></li>
<li class="toctree-l3"><a class="reference internal" href="dataset_vision/mindspore.dataset.vision.c_transforms.RandomColorAdjust.html">mindspore.dataset.vision.c_transforms.RandomColorAdjust</a></li>
<li class="toctree-l3"><a class="reference internal" href="dataset_vision/mindspore.dataset.vision.c_transforms.RandomCrop.html">mindspore.dataset.vision.c_transforms.RandomCrop</a></li>
<li class="toctree-l3"><a class="reference internal" href="dataset_vision/mindspore.dataset.vision.c_transforms.RandomCropDecodeResize.html">mindspore.dataset.vision.c_transforms.RandomCropDecodeResize</a></li>
<li class="toctree-l3"><a class="reference internal" href="dataset_vision/mindspore.dataset.vision.c_transforms.RandomCropWithBBox.html">mindspore.dataset.vision.c_transforms.RandomCropWithBBox</a></li>
<li class="toctree-l3"><a class="reference internal" href="dataset_vision/mindspore.dataset.vision.c_transforms.RandomHorizontalFlip.html">mindspore.dataset.vision.c_transforms.RandomHorizontalFlip</a></li>
<li class="toctree-l3"><a class="reference internal" href="dataset_vision/mindspore.dataset.vision.c_transforms.RandomHorizontalFlipWithBBox.html">mindspore.dataset.vision.c_transforms.RandomHorizontalFlipWithBBox</a></li>
<li class="toctree-l3"><a class="reference internal" href="dataset_vision/mindspore.dataset.vision.c_transforms.RandomPosterize.html">mindspore.dataset.vision.c_transforms.RandomPosterize</a></li>
<li class="toctree-l3"><a class="reference internal" href="dataset_vision/mindspore.dataset.vision.c_transforms.RandomResize.html">mindspore.dataset.vision.c_transforms.RandomResize</a></li>
<li class="toctree-l3"><a class="reference internal" href="dataset_vision/mindspore.dataset.vision.c_transforms.RandomResizedCrop.html">mindspore.dataset.vision.c_transforms.RandomResizedCrop</a></li>
<li class="toctree-l3"><a class="reference internal" href="dataset_vision/mindspore.dataset.vision.c_transforms.RandomResizedCropWithBBox.html">mindspore.dataset.vision.c_transforms.RandomResizedCropWithBBox</a></li>
<li class="toctree-l3"><a class="reference internal" href="dataset_vision/mindspore.dataset.vision.c_transforms.RandomResizeWithBBox.html">mindspore.dataset.vision.c_transforms.RandomResizeWithBBox</a></li>
<li class="toctree-l3"><a class="reference internal" href="dataset_vision/mindspore.dataset.vision.c_transforms.RandomRotation.html">mindspore.dataset.vision.c_transforms.RandomRotation</a></li>
<li class="toctree-l3"><a class="reference internal" href="dataset_vision/mindspore.dataset.vision.c_transforms.RandomSelectSubpolicy.html">mindspore.dataset.vision.c_transforms.RandomSelectSubpolicy</a></li>
<li class="toctree-l3"><a class="reference internal" href="dataset_vision/mindspore.dataset.vision.c_transforms.RandomSharpness.html">mindspore.dataset.vision.c_transforms.RandomSharpness</a></li>
<li class="toctree-l3"><a class="reference internal" href="dataset_vision/mindspore.dataset.vision.c_transforms.RandomSolarize.html">mindspore.dataset.vision.c_transforms.RandomSolarize</a></li>
<li class="toctree-l3"><a class="reference internal" href="dataset_vision/mindspore.dataset.vision.c_transforms.RandomVerticalFlip.html">mindspore.dataset.vision.c_transforms.RandomVerticalFlip</a></li>
<li class="toctree-l3"><a class="reference internal" href="dataset_vision/mindspore.dataset.vision.c_transforms.RandomVerticalFlipWithBBox.html">mindspore.dataset.vision.c_transforms.RandomVerticalFlipWithBBox</a></li>
<li class="toctree-l3"><a class="reference internal" href="dataset_vision/mindspore.dataset.vision.c_transforms.Rescale.html">mindspore.dataset.vision.c_transforms.Rescale</a></li>
<li class="toctree-l3"><a class="reference internal" href="dataset_vision/mindspore.dataset.vision.c_transforms.Resize.html">mindspore.dataset.vision.c_transforms.Resize</a></li>
<li class="toctree-l3"><a class="reference internal" href="dataset_vision/mindspore.dataset.vision.c_transforms.ResizeWithBBox.html">mindspore.dataset.vision.c_transforms.ResizeWithBBox</a></li>
<li class="toctree-l3"><a class="reference internal" href="dataset_vision/mindspore.dataset.vision.c_transforms.Rotate.html">mindspore.dataset.vision.c_transforms.Rotate</a></li>
<li class="toctree-l3"><a class="reference internal" href="dataset_vision/mindspore.dataset.vision.c_transforms.SlicePatches.html">mindspore.dataset.vision.c_transforms.SlicePatches</a></li>
<li class="toctree-l3"><a class="reference internal" href="dataset_vision/mindspore.dataset.vision.c_transforms.SoftDvppDecodeRandomCropResizeJpeg.html">mindspore.dataset.vision.c_transforms.SoftDvppDecodeRandomCropResizeJpeg</a></li>
<li class="toctree-l3"><a class="reference internal" href="dataset_vision/mindspore.dataset.vision.c_transforms.SoftDvppDecodeResizeJpeg.html">mindspore.dataset.vision.c_transforms.SoftDvppDecodeResizeJpeg</a></li>
<li class="toctree-l3"><a class="reference internal" href="dataset_vision/mindspore.dataset.vision.c_transforms.UniformAugment.html">mindspore.dataset.vision.c_transforms.UniformAugment</a></li>
<li class="toctree-l3"><a class="reference internal" href="dataset_vision/mindspore.dataset.vision.c_transforms.VerticalFlip.html">mindspore.dataset.vision.c_transforms.VerticalFlip</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="#mindspore-dataset-vision-py-transforms">mindspore.dataset.vision.py_transforms</a><ul>
<li class="toctree-l3"><a class="reference internal" href="dataset_vision/mindspore.dataset.vision.py_transforms.AutoContrast.html">mindspore.dataset.vision.py_transforms.AutoContrast</a></li>
<li class="toctree-l3"><a class="reference internal" href="dataset_vision/mindspore.dataset.vision.py_transforms.CenterCrop.html">mindspore.dataset.vision.py_transforms.CenterCrop</a></li>
<li class="toctree-l3"><a class="reference internal" href="dataset_vision/mindspore.dataset.vision.py_transforms.Cutout.html">mindspore.dataset.vision.py_transforms.Cutout</a></li>
<li class="toctree-l3"><a class="reference internal" href="dataset_vision/mindspore.dataset.vision.py_transforms.Decode.html">mindspore.dataset.vision.py_transforms.Decode</a></li>
<li class="toctree-l3"><a class="reference internal" href="dataset_vision/mindspore.dataset.vision.py_transforms.Equalize.html">mindspore.dataset.vision.py_transforms.Equalize</a></li>
<li class="toctree-l3"><a class="reference internal" href="dataset_vision/mindspore.dataset.vision.py_transforms.FiveCrop.html">mindspore.dataset.vision.py_transforms.FiveCrop</a></li>
<li class="toctree-l3"><a class="reference internal" href="dataset_vision/mindspore.dataset.vision.py_transforms.Grayscale.html">mindspore.dataset.vision.py_transforms.Grayscale</a></li>
<li class="toctree-l3"><a class="reference internal" href="dataset_vision/mindspore.dataset.vision.py_transforms.HsvToRgb.html">mindspore.dataset.vision.py_transforms.HsvToRgb</a></li>
<li class="toctree-l3"><a class="reference internal" href="dataset_vision/mindspore.dataset.vision.py_transforms.HWC2CHW.html">mindspore.dataset.vision.py_transforms.HWC2CHW</a></li>
<li class="toctree-l3"><a class="reference internal" href="dataset_vision/mindspore.dataset.vision.py_transforms.Invert.html">mindspore.dataset.vision.py_transforms.Invert</a></li>
<li class="toctree-l3"><a class="reference internal" href="dataset_vision/mindspore.dataset.vision.py_transforms.LinearTransformation.html">mindspore.dataset.vision.py_transforms.LinearTransformation</a></li>
<li class="toctree-l3"><a class="reference internal" href="dataset_vision/mindspore.dataset.vision.py_transforms.MixUp.html">mindspore.dataset.vision.py_transforms.MixUp</a></li>
<li class="toctree-l3"><a class="reference internal" href="dataset_vision/mindspore.dataset.vision.py_transforms.Normalize.html">mindspore.dataset.vision.py_transforms.Normalize</a></li>
<li class="toctree-l3"><a class="reference internal" href="dataset_vision/mindspore.dataset.vision.py_transforms.NormalizePad.html">mindspore.dataset.vision.py_transforms.NormalizePad</a></li>
<li class="toctree-l3"><a class="reference internal" href="dataset_vision/mindspore.dataset.vision.py_transforms.Pad.html">mindspore.dataset.vision.py_transforms.Pad</a></li>
<li class="toctree-l3"><a class="reference internal" href="dataset_vision/mindspore.dataset.vision.py_transforms.RandomAffine.html">mindspore.dataset.vision.py_transforms.RandomAffine</a></li>
<li class="toctree-l3"><a class="reference internal" href="dataset_vision/mindspore.dataset.vision.py_transforms.RandomColor.html">mindspore.dataset.vision.py_transforms.RandomColor</a></li>
<li class="toctree-l3"><a class="reference internal" href="dataset_vision/mindspore.dataset.vision.py_transforms.RandomColorAdjust.html">mindspore.dataset.vision.py_transforms.RandomColorAdjust</a></li>
<li class="toctree-l3"><a class="reference internal" href="dataset_vision/mindspore.dataset.vision.py_transforms.RandomCrop.html">mindspore.dataset.vision.py_transforms.RandomCrop</a></li>
<li class="toctree-l3"><a class="reference internal" href="dataset_vision/mindspore.dataset.vision.py_transforms.RandomErasing.html">mindspore.dataset.vision.py_transforms.RandomErasing</a></li>
<li class="toctree-l3"><a class="reference internal" href="dataset_vision/mindspore.dataset.vision.py_transforms.RandomGrayscale.html">mindspore.dataset.vision.py_transforms.RandomGrayscale</a></li>
<li class="toctree-l3"><a class="reference internal" href="dataset_vision/mindspore.dataset.vision.py_transforms.RandomHorizontalFlip.html">mindspore.dataset.vision.py_transforms.RandomHorizontalFlip</a></li>
<li class="toctree-l3"><a class="reference internal" href="dataset_vision/mindspore.dataset.vision.py_transforms.RandomPerspective.html">mindspore.dataset.vision.py_transforms.RandomPerspective</a></li>
<li class="toctree-l3"><a class="reference internal" href="dataset_vision/mindspore.dataset.vision.py_transforms.RandomResizedCrop.html">mindspore.dataset.vision.py_transforms.RandomResizedCrop</a></li>
<li class="toctree-l3"><a class="reference internal" href="dataset_vision/mindspore.dataset.vision.py_transforms.RandomRotation.html">mindspore.dataset.vision.py_transforms.RandomRotation</a></li>
<li class="toctree-l3"><a class="reference internal" href="dataset_vision/mindspore.dataset.vision.py_transforms.RandomSharpness.html">mindspore.dataset.vision.py_transforms.RandomSharpness</a></li>
<li class="toctree-l3"><a class="reference internal" href="dataset_vision/mindspore.dataset.vision.py_transforms.RandomVerticalFlip.html">mindspore.dataset.vision.py_transforms.RandomVerticalFlip</a></li>
<li class="toctree-l3"><a class="reference internal" href="dataset_vision/mindspore.dataset.vision.py_transforms.Resize.html">mindspore.dataset.vision.py_transforms.Resize</a></li>
<li class="toctree-l3"><a class="reference internal" href="dataset_vision/mindspore.dataset.vision.py_transforms.RgbToHsv.html">mindspore.dataset.vision.py_transforms.RgbToHsv</a></li>
<li class="toctree-l3"><a class="reference internal" href="dataset_vision/mindspore.dataset.vision.py_transforms.TenCrop.html">mindspore.dataset.vision.py_transforms.TenCrop</a></li>
<li class="toctree-l3"><a class="reference internal" href="dataset_vision/mindspore.dataset.vision.py_transforms.ToPIL.html">mindspore.dataset.vision.py_transforms.ToPIL</a></li>
<li class="toctree-l3"><a class="reference internal" href="dataset_vision/mindspore.dataset.vision.py_transforms.ToTensor.html">mindspore.dataset.vision.py_transforms.ToTensor</a></li>
<li class="toctree-l3"><a class="reference internal" href="dataset_vision/mindspore.dataset.vision.py_transforms.ToType.html">mindspore.dataset.vision.py_transforms.ToType</a></li>
<li class="toctree-l3"><a class="reference internal" href="dataset_vision/mindspore.dataset.vision.py_transforms.UniformAugment.html">mindspore.dataset.vision.py_transforms.UniformAugment</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="#mindspore-dataset-vision-utils">mindspore.dataset.vision.utils</a><ul>
<li class="toctree-l3"><a class="reference internal" href="dataset_vision/mindspore.dataset.vision.Border.html">mindspore.dataset.vision.Border</a></li>
<li class="toctree-l3"><a class="reference internal" href="dataset_vision/mindspore.dataset.vision.ConvertMode.html">mindspore.dataset.vision.ConvertMode</a></li>
<li class="toctree-l3"><a class="reference internal" href="dataset_vision/mindspore.dataset.vision.ImageBatchFormat.html">mindspore.dataset.vision.ImageBatchFormat</a></li>
<li class="toctree-l3"><a class="reference internal" href="dataset_vision/mindspore.dataset.vision.Inter.html">mindspore.dataset.vision.Inter</a></li>
<li class="toctree-l3"><a class="reference internal" href="dataset_vision/mindspore.dataset.vision.SliceMode.html">mindspore.dataset.vision.SliceMode</a></li>
</ul>
</li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="mindspore.mindrecord.html">mindspore.mindrecord</a></li>
<li class="toctree-l1"><a class="reference internal" href="mindspore.nn.html">mindspore.nn</a></li>
<li class="toctree-l1"><a class="reference internal" href="mindspore.nn.probability.html">mindspore.nn.probability</a></li>
<li class="toctree-l1"><a class="reference internal" href="mindspore.nn.transformer.html">mindspore.nn.transformer</a></li>
<li class="toctree-l1"><a class="reference internal" href="mindspore.numpy.html">mindspore.numpy</a></li>
<li class="toctree-l1"><a class="reference internal" href="mindspore.ops.html">mindspore.ops</a></li>
<li class="toctree-l1"><a class="reference internal" href="mindspore.parallel.html">mindspore.parallel</a></li>
<li class="toctree-l1"><a class="reference internal" href="mindspore.parallel.nn.html">mindspore.parallel.nn</a></li>
<li class="toctree-l1"><a class="reference internal" href="mindspore.profiler.html">mindspore.profiler</a></li>
<li class="toctree-l1"><a class="reference internal" href="mindspore.scipy.html">mindspore.scipy</a></li>
<li class="toctree-l1"><a class="reference internal" href="mindspore.train.html">mindspore.train</a></li>
<li class="toctree-l1"><a class="reference internal" href="mindspore.boost.html">mindspore.boost</a></li>
</ul>
<p class="caption"><span class="caption-text">MindSpore C++ API</span></p>
<ul>
<li class="toctree-l1"><a class="reference external" href="https://www.mindspore.cn/lite/api/zh-CN/master/api_cpp/mindspore.html">MindSpore Lite↗</a></li>
</ul>

            
          
        </div>
        
      </div>
    </nav>

    <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">

      
      <nav class="wy-nav-top" aria-label="top navigation">
        
          <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
          <a href="../index.html">MindSpore</a>
        
      </nav>


      <div class="wy-nav-content">
        
        <div class="rst-content">
        
          

















<div role="navigation" aria-label="breadcrumbs navigation">

  <ul class="wy-breadcrumbs">
    
      <li><a href="../index.html" class="icon icon-home"></a> &raquo;</li>
        
      <li>mindspore.dataset.vision</li>
    
    
      <li class="wy-breadcrumbs-aside">
        
          
            <a href="../_sources/api_python/mindspore.dataset.vision.rst.txt" rel="nofollow"> View page source</a>
          
        
      </li>
    
  </ul>

  
  <hr/>
</div>
          <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
           <div itemprop="articleBody">
            
  <div class="section" id="mindspore-dataset-vision">
<h1>mindspore.dataset.vision<a class="headerlink" href="#mindspore-dataset-vision" title="Permalink to this headline">¶</a></h1>
<p>此模块用于图像数据增强，包括 <cite>c_transforms</cite> 和 <cite>py_transforms</cite> 两个子模块。
<cite>c_transforms</cite> 是使用 C++ OpenCv 开发的高性能图像增强模块。
<cite>py_transforms</cite> 是使用 Python Pillow 开发的图像增强模块。</p>
<p>API样例中常用的导入模块如下：</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="kn">import</span> <span class="nn">mindspore.dataset.vision.c_transforms</span> <span class="k">as</span> <span class="nn">c_vision</span>
<span class="kn">import</span> <span class="nn">mindspore.dataset.vision.py_transforms</span> <span class="k">as</span> <span class="nn">py_vision</span>
<span class="kn">from</span> <span class="nn">mindspore.dataset.transforms</span> <span class="kn">import</span> <span class="n">c_transforms</span>
</pre></div>
</div>
<div class="section" id="mindspore-dataset-vision-c-transforms">
<h2>mindspore.dataset.vision.c_transforms<a class="headerlink" href="#mindspore-dataset-vision-c-transforms" title="Permalink to this headline">¶</a></h2>
<table class="longtable docutils align-default">
<colgroup>
<col style="width: 10%" />
<col style="width: 90%" />
</colgroup>
<tbody>
<tr class="row-odd"></tr>
<tr class="row-even"><td><p><a class="reference internal" href="dataset_vision/mindspore.dataset.vision.c_transforms.AutoContrast.html#mindspore.dataset.vision.c_transforms.AutoContrast" title="mindspore.dataset.vision.c_transforms.AutoContrast"><code class="xref py py-obj docutils literal notranslate"><span class="pre">mindspore.dataset.vision.c_transforms.AutoContrast</span></code></a></p></td>
<td><p>在输入图像上应用自动对比度。</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="dataset_vision/mindspore.dataset.vision.c_transforms.BoundingBoxAugment.html#mindspore.dataset.vision.c_transforms.BoundingBoxAugment" title="mindspore.dataset.vision.c_transforms.BoundingBoxAugment"><code class="xref py py-obj docutils literal notranslate"><span class="pre">mindspore.dataset.vision.c_transforms.BoundingBoxAugment</span></code></a></p></td>
<td><p>对图像的标注边界框(bounding box)区域随机应用给定的图像变换处理。</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="dataset_vision/mindspore.dataset.vision.c_transforms.CenterCrop.html#mindspore.dataset.vision.c_transforms.CenterCrop" title="mindspore.dataset.vision.c_transforms.CenterCrop"><code class="xref py py-obj docutils literal notranslate"><span class="pre">mindspore.dataset.vision.c_transforms.CenterCrop</span></code></a></p></td>
<td><p>对输入图像应用中心区域裁剪。</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="dataset_vision/mindspore.dataset.vision.c_transforms.ConvertColor.html#mindspore.dataset.vision.c_transforms.ConvertColor" title="mindspore.dataset.vision.c_transforms.ConvertColor"><code class="xref py py-obj docutils literal notranslate"><span class="pre">mindspore.dataset.vision.c_transforms.ConvertColor</span></code></a></p></td>
<td><p>更改图像的色彩空间。</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="dataset_vision/mindspore.dataset.vision.c_transforms.Crop.html#mindspore.dataset.vision.c_transforms.Crop" title="mindspore.dataset.vision.c_transforms.Crop"><code class="xref py py-obj docutils literal notranslate"><span class="pre">mindspore.dataset.vision.c_transforms.Crop</span></code></a></p></td>
<td><p>在输入图像上裁剪出指定区域。</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="dataset_vision/mindspore.dataset.vision.c_transforms.CutMixBatch.html#mindspore.dataset.vision.c_transforms.CutMixBatch" title="mindspore.dataset.vision.c_transforms.CutMixBatch"><code class="xref py py-obj docutils literal notranslate"><span class="pre">mindspore.dataset.vision.c_transforms.CutMixBatch</span></code></a></p></td>
<td><p>对输入批次的图像和标签应用剪切混合转换。</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="dataset_vision/mindspore.dataset.vision.c_transforms.CutOut.html#mindspore.dataset.vision.c_transforms.CutOut" title="mindspore.dataset.vision.c_transforms.CutOut"><code class="xref py py-obj docutils literal notranslate"><span class="pre">mindspore.dataset.vision.c_transforms.CutOut</span></code></a></p></td>
<td><p>从输入图像数组中随机裁剪出给定数量的正方形区域。</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="dataset_vision/mindspore.dataset.vision.c_transforms.Decode.html#mindspore.dataset.vision.c_transforms.Decode" title="mindspore.dataset.vision.c_transforms.Decode"><code class="xref py py-obj docutils literal notranslate"><span class="pre">mindspore.dataset.vision.c_transforms.Decode</span></code></a></p></td>
<td><p>以 RGB 模式（默认）或 BGR 模式（选项已弃用）解码输入图像。</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="dataset_vision/mindspore.dataset.vision.c_transforms.Equalize.html#mindspore.dataset.vision.c_transforms.Equalize" title="mindspore.dataset.vision.c_transforms.Equalize"><code class="xref py py-obj docutils literal notranslate"><span class="pre">mindspore.dataset.vision.c_transforms.Equalize</span></code></a></p></td>
<td><p>对输入图像应用直方图均衡。</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="dataset_vision/mindspore.dataset.vision.c_transforms.GaussianBlur.html#mindspore.dataset.vision.c_transforms.GaussianBlur" title="mindspore.dataset.vision.c_transforms.GaussianBlur"><code class="xref py py-obj docutils literal notranslate"><span class="pre">mindspore.dataset.vision.c_transforms.GaussianBlur</span></code></a></p></td>
<td><p>使用指定的高斯核对输入图像进行模糊处理。</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="dataset_vision/mindspore.dataset.vision.c_transforms.HorizontalFlip.html#mindspore.dataset.vision.c_transforms.HorizontalFlip" title="mindspore.dataset.vision.c_transforms.HorizontalFlip"><code class="xref py py-obj docutils literal notranslate"><span class="pre">mindspore.dataset.vision.c_transforms.HorizontalFlip</span></code></a></p></td>
<td><p>水平翻转输入图像。</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="dataset_vision/mindspore.dataset.vision.c_transforms.HWC2CHW.html#mindspore.dataset.vision.c_transforms.HWC2CHW" title="mindspore.dataset.vision.c_transforms.HWC2CHW"><code class="xref py py-obj docutils literal notranslate"><span class="pre">mindspore.dataset.vision.c_transforms.HWC2CHW</span></code></a></p></td>
<td><p>将输入图像从形状 (H, W, C) 转置为形状 (C, H, W)。</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="dataset_vision/mindspore.dataset.vision.c_transforms.Invert.html#mindspore.dataset.vision.c_transforms.Invert" title="mindspore.dataset.vision.c_transforms.Invert"><code class="xref py py-obj docutils literal notranslate"><span class="pre">mindspore.dataset.vision.c_transforms.Invert</span></code></a></p></td>
<td><p>在 RGB 模式下对输入图像应用像素反转, 计算方式为（255 - pixel）。</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="dataset_vision/mindspore.dataset.vision.c_transforms.MixUpBatch.html#mindspore.dataset.vision.c_transforms.MixUpBatch" title="mindspore.dataset.vision.c_transforms.MixUpBatch"><code class="xref py py-obj docutils literal notranslate"><span class="pre">mindspore.dataset.vision.c_transforms.MixUpBatch</span></code></a></p></td>
<td><p>对输入批次的图像和标签应用混合转换。</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="dataset_vision/mindspore.dataset.vision.c_transforms.Normalize.html#mindspore.dataset.vision.c_transforms.Normalize" title="mindspore.dataset.vision.c_transforms.Normalize"><code class="xref py py-obj docutils literal notranslate"><span class="pre">mindspore.dataset.vision.c_transforms.Normalize</span></code></a></p></td>
<td><p>根据均值和标准差对输入图像进行归一化。</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="dataset_vision/mindspore.dataset.vision.c_transforms.NormalizePad.html#mindspore.dataset.vision.c_transforms.NormalizePad" title="mindspore.dataset.vision.c_transforms.NormalizePad"><code class="xref py py-obj docutils literal notranslate"><span class="pre">mindspore.dataset.vision.c_transforms.NormalizePad</span></code></a></p></td>
<td><p>根据均值和标准差对输入图像进行归一化，然后用零值填充一个额外的通道。</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="dataset_vision/mindspore.dataset.vision.c_transforms.Pad.html#mindspore.dataset.vision.c_transforms.Pad" title="mindspore.dataset.vision.c_transforms.Pad"><code class="xref py py-obj docutils literal notranslate"><span class="pre">mindspore.dataset.vision.c_transforms.Pad</span></code></a></p></td>
<td><p>根据填充参数填充图像。</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="dataset_vision/mindspore.dataset.vision.c_transforms.RandomAffine.html#mindspore.dataset.vision.c_transforms.RandomAffine" title="mindspore.dataset.vision.c_transforms.RandomAffine"><code class="xref py py-obj docutils literal notranslate"><span class="pre">mindspore.dataset.vision.c_transforms.RandomAffine</span></code></a></p></td>
<td><p>对输入图像应用随机仿射变换。</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="dataset_vision/mindspore.dataset.vision.c_transforms.RandomColor.html#mindspore.dataset.vision.c_transforms.RandomColor" title="mindspore.dataset.vision.c_transforms.RandomColor"><code class="xref py py-obj docutils literal notranslate"><span class="pre">mindspore.dataset.vision.c_transforms.RandomColor</span></code></a></p></td>
<td><p>随机调整输入图像的颜色。</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="dataset_vision/mindspore.dataset.vision.c_transforms.RandomColorAdjust.html#mindspore.dataset.vision.c_transforms.RandomColorAdjust" title="mindspore.dataset.vision.c_transforms.RandomColorAdjust"><code class="xref py py-obj docutils literal notranslate"><span class="pre">mindspore.dataset.vision.c_transforms.RandomColorAdjust</span></code></a></p></td>
<td><p>随机调整输入图像的亮度、对比度、饱和度和色调。</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="dataset_vision/mindspore.dataset.vision.c_transforms.RandomCrop.html#mindspore.dataset.vision.c_transforms.RandomCrop" title="mindspore.dataset.vision.c_transforms.RandomCrop"><code class="xref py py-obj docutils literal notranslate"><span class="pre">mindspore.dataset.vision.c_transforms.RandomCrop</span></code></a></p></td>
<td><p>对输入图像进行随机区域的裁剪。</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="dataset_vision/mindspore.dataset.vision.c_transforms.RandomCropDecodeResize.html#mindspore.dataset.vision.c_transforms.RandomCropDecodeResize" title="mindspore.dataset.vision.c_transforms.RandomCropDecodeResize"><code class="xref py py-obj docutils literal notranslate"><span class="pre">mindspore.dataset.vision.c_transforms.RandomCropDecodeResize</span></code></a></p></td>
<td><p>“裁剪”、”解码”和”调整大小”的组合处理。</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="dataset_vision/mindspore.dataset.vision.c_transforms.RandomCropWithBBox.html#mindspore.dataset.vision.c_transforms.RandomCropWithBBox" title="mindspore.dataset.vision.c_transforms.RandomCropWithBBox"><code class="xref py py-obj docutils literal notranslate"><span class="pre">mindspore.dataset.vision.c_transforms.RandomCropWithBBox</span></code></a></p></td>
<td><p>对输入图像进行随机位置裁剪并相应地调整边界框。</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="dataset_vision/mindspore.dataset.vision.c_transforms.RandomHorizontalFlip.html#mindspore.dataset.vision.c_transforms.RandomHorizontalFlip" title="mindspore.dataset.vision.c_transforms.RandomHorizontalFlip"><code class="xref py py-obj docutils literal notranslate"><span class="pre">mindspore.dataset.vision.c_transforms.RandomHorizontalFlip</span></code></a></p></td>
<td><p>以给定的概率水平随机翻转输入图像。</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="dataset_vision/mindspore.dataset.vision.c_transforms.RandomHorizontalFlipWithBBox.html#mindspore.dataset.vision.c_transforms.RandomHorizontalFlipWithBBox" title="mindspore.dataset.vision.c_transforms.RandomHorizontalFlipWithBBox"><code class="xref py py-obj docutils literal notranslate"><span class="pre">mindspore.dataset.vision.c_transforms.RandomHorizontalFlipWithBBox</span></code></a></p></td>
<td><p>以给定的概率水平随机翻转输入图像并相应地调整边界框。</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="dataset_vision/mindspore.dataset.vision.c_transforms.RandomPosterize.html#mindspore.dataset.vision.c_transforms.RandomPosterize" title="mindspore.dataset.vision.c_transforms.RandomPosterize"><code class="xref py py-obj docutils literal notranslate"><span class="pre">mindspore.dataset.vision.c_transforms.RandomPosterize</span></code></a></p></td>
<td><p>随机减少输入图像每个颜色通道的位数。</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="dataset_vision/mindspore.dataset.vision.c_transforms.RandomResize.html#mindspore.dataset.vision.c_transforms.RandomResize" title="mindspore.dataset.vision.c_transforms.RandomResize"><code class="xref py py-obj docutils literal notranslate"><span class="pre">mindspore.dataset.vision.c_transforms.RandomResize</span></code></a></p></td>
<td><p>使用随机选择的插值模式调整输入图像的大小。</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="dataset_vision/mindspore.dataset.vision.c_transforms.RandomResizedCrop.html#mindspore.dataset.vision.c_transforms.RandomResizedCrop" title="mindspore.dataset.vision.c_transforms.RandomResizedCrop"><code class="xref py py-obj docutils literal notranslate"><span class="pre">mindspore.dataset.vision.c_transforms.RandomResizedCrop</span></code></a></p></td>
<td><p>对输入图像进行随机裁剪，并使用指定的插值模式调整裁剪后的图像为指定的大小。</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="dataset_vision/mindspore.dataset.vision.c_transforms.RandomResizedCropWithBBox.html#mindspore.dataset.vision.c_transforms.RandomResizedCropWithBBox" title="mindspore.dataset.vision.c_transforms.RandomResizedCropWithBBox"><code class="xref py py-obj docutils literal notranslate"><span class="pre">mindspore.dataset.vision.c_transforms.RandomResizedCropWithBBox</span></code></a></p></td>
<td><p>对输入图像进行随机裁剪且随机调整纵横比，并将处理后的图像调整为指定的大小，并相应地调整边界框。</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="dataset_vision/mindspore.dataset.vision.c_transforms.RandomResizeWithBBox.html#mindspore.dataset.vision.c_transforms.RandomResizeWithBBox" title="mindspore.dataset.vision.c_transforms.RandomResizeWithBBox"><code class="xref py py-obj docutils literal notranslate"><span class="pre">mindspore.dataset.vision.c_transforms.RandomResizeWithBBox</span></code></a></p></td>
<td><p>使用随机选择的插值模式来调整输入图像的大小，并相应地调整边界框的大小。</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="dataset_vision/mindspore.dataset.vision.c_transforms.RandomRotation.html#mindspore.dataset.vision.c_transforms.RandomRotation" title="mindspore.dataset.vision.c_transforms.RandomRotation"><code class="xref py py-obj docutils literal notranslate"><span class="pre">mindspore.dataset.vision.c_transforms.RandomRotation</span></code></a></p></td>
<td><p>在指定的角度范围内，随机旋转输入图像。</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="dataset_vision/mindspore.dataset.vision.c_transforms.RandomSelectSubpolicy.html#mindspore.dataset.vision.c_transforms.RandomSelectSubpolicy" title="mindspore.dataset.vision.c_transforms.RandomSelectSubpolicy"><code class="xref py py-obj docutils literal notranslate"><span class="pre">mindspore.dataset.vision.c_transforms.RandomSelectSubpolicy</span></code></a></p></td>
<td><p>从策略列表中选择一个随机子策略以应用于输入图像。</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="dataset_vision/mindspore.dataset.vision.c_transforms.RandomSharpness.html#mindspore.dataset.vision.c_transforms.RandomSharpness" title="mindspore.dataset.vision.c_transforms.RandomSharpness"><code class="xref py py-obj docutils literal notranslate"><span class="pre">mindspore.dataset.vision.c_transforms.RandomSharpness</span></code></a></p></td>
<td><p>在给定的范围随机内地调整输入图像的锐度。</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="dataset_vision/mindspore.dataset.vision.c_transforms.RandomSolarize.html#mindspore.dataset.vision.c_transforms.RandomSolarize" title="mindspore.dataset.vision.c_transforms.RandomSolarize"><code class="xref py py-obj docutils literal notranslate"><span class="pre">mindspore.dataset.vision.c_transforms.RandomSolarize</span></code></a></p></td>
<td><p>从给定阈值范围内随机选择一个子范围，并对像素值位于给定子范围内的像素，将其值设置为（255 - 原本像素值）。</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="dataset_vision/mindspore.dataset.vision.c_transforms.RandomVerticalFlip.html#mindspore.dataset.vision.c_transforms.RandomVerticalFlip" title="mindspore.dataset.vision.c_transforms.RandomVerticalFlip"><code class="xref py py-obj docutils literal notranslate"><span class="pre">mindspore.dataset.vision.c_transforms.RandomVerticalFlip</span></code></a></p></td>
<td><p>以给定的概率对输入图像在垂直方向进行随机翻转。</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="dataset_vision/mindspore.dataset.vision.c_transforms.RandomVerticalFlipWithBBox.html#mindspore.dataset.vision.c_transforms.RandomVerticalFlipWithBBox" title="mindspore.dataset.vision.c_transforms.RandomVerticalFlipWithBBox"><code class="xref py py-obj docutils literal notranslate"><span class="pre">mindspore.dataset.vision.c_transforms.RandomVerticalFlipWithBBox</span></code></a></p></td>
<td><p>以给定的概率对输入图像和边界框在垂直方向进行随机翻转。</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="dataset_vision/mindspore.dataset.vision.c_transforms.Rescale.html#mindspore.dataset.vision.c_transforms.Rescale" title="mindspore.dataset.vision.c_transforms.Rescale"><code class="xref py py-obj docutils literal notranslate"><span class="pre">mindspore.dataset.vision.c_transforms.Rescale</span></code></a></p></td>
<td><p>基于给定的缩放和平移因子调整图像的大小。</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="dataset_vision/mindspore.dataset.vision.c_transforms.Resize.html#mindspore.dataset.vision.c_transforms.Resize" title="mindspore.dataset.vision.c_transforms.Resize"><code class="xref py py-obj docutils literal notranslate"><span class="pre">mindspore.dataset.vision.c_transforms.Resize</span></code></a></p></td>
<td><p>使用给定的插值模式将输入图像调整为给定的大小。</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="dataset_vision/mindspore.dataset.vision.c_transforms.ResizeWithBBox.html#mindspore.dataset.vision.c_transforms.ResizeWithBBox" title="mindspore.dataset.vision.c_transforms.ResizeWithBBox"><code class="xref py py-obj docutils literal notranslate"><span class="pre">mindspore.dataset.vision.c_transforms.ResizeWithBBox</span></code></a></p></td>
<td><p>将输入图像调整为给定的大小并相应地调整边界框的大小。</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="dataset_vision/mindspore.dataset.vision.c_transforms.Rotate.html#mindspore.dataset.vision.c_transforms.Rotate" title="mindspore.dataset.vision.c_transforms.Rotate"><code class="xref py py-obj docutils literal notranslate"><span class="pre">mindspore.dataset.vision.c_transforms.Rotate</span></code></a></p></td>
<td><p>将输入图像旋转指定的度数。</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="dataset_vision/mindspore.dataset.vision.c_transforms.SlicePatches.html#mindspore.dataset.vision.c_transforms.SlicePatches" title="mindspore.dataset.vision.c_transforms.SlicePatches"><code class="xref py py-obj docutils literal notranslate"><span class="pre">mindspore.dataset.vision.c_transforms.SlicePatches</span></code></a></p></td>
<td><p>在水平和垂直方向上将Tensor切片为多个块。</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="dataset_vision/mindspore.dataset.vision.c_transforms.SoftDvppDecodeRandomCropResizeJpeg.html#mindspore.dataset.vision.c_transforms.SoftDvppDecodeRandomCropResizeJpeg" title="mindspore.dataset.vision.c_transforms.SoftDvppDecodeRandomCropResizeJpeg"><code class="xref py py-obj docutils literal notranslate"><span class="pre">mindspore.dataset.vision.c_transforms.SoftDvppDecodeRandomCropResizeJpeg</span></code></a></p></td>
<td><p>使用Ascend系列芯片DVPP模块的模拟算法组合了 <cite>Crop</cite> 、 <cite>Decode</cite> 和 <cite>Resize</cite> 。</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="dataset_vision/mindspore.dataset.vision.c_transforms.SoftDvppDecodeResizeJpeg.html#mindspore.dataset.vision.c_transforms.SoftDvppDecodeResizeJpeg" title="mindspore.dataset.vision.c_transforms.SoftDvppDecodeResizeJpeg"><code class="xref py py-obj docutils literal notranslate"><span class="pre">mindspore.dataset.vision.c_transforms.SoftDvppDecodeResizeJpeg</span></code></a></p></td>
<td><p>使用Ascend系列芯片DVPP模块的仿真算法对JPEG图像进行解码和缩放。</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="dataset_vision/mindspore.dataset.vision.c_transforms.UniformAugment.html#mindspore.dataset.vision.c_transforms.UniformAugment" title="mindspore.dataset.vision.c_transforms.UniformAugment"><code class="xref py py-obj docutils literal notranslate"><span class="pre">mindspore.dataset.vision.c_transforms.UniformAugment</span></code></a></p></td>
<td><p>对输入图像执行随机选取的数据增强操作。</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="dataset_vision/mindspore.dataset.vision.c_transforms.VerticalFlip.html#mindspore.dataset.vision.c_transforms.VerticalFlip" title="mindspore.dataset.vision.c_transforms.VerticalFlip"><code class="xref py py-obj docutils literal notranslate"><span class="pre">mindspore.dataset.vision.c_transforms.VerticalFlip</span></code></a></p></td>
<td><p>对输入图像进行垂直翻转。</p></td>
</tr>
</tbody>
</table>
</div>
<div class="section" id="mindspore-dataset-vision-py-transforms">
<h2>mindspore.dataset.vision.py_transforms<a class="headerlink" href="#mindspore-dataset-vision-py-transforms" title="Permalink to this headline">¶</a></h2>
<table class="longtable docutils align-default">
<colgroup>
<col style="width: 10%" />
<col style="width: 90%" />
</colgroup>
<tbody>
<tr class="row-odd"></tr>
<tr class="row-even"><td><p><a class="reference internal" href="dataset_vision/mindspore.dataset.vision.py_transforms.AutoContrast.html#mindspore.dataset.vision.py_transforms.AutoContrast" title="mindspore.dataset.vision.py_transforms.AutoContrast"><code class="xref py py-obj docutils literal notranslate"><span class="pre">mindspore.dataset.vision.py_transforms.AutoContrast</span></code></a></p></td>
<td><p>最大化（标准化）输入PIL图像的对比度。</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="dataset_vision/mindspore.dataset.vision.py_transforms.CenterCrop.html#mindspore.dataset.vision.py_transforms.CenterCrop" title="mindspore.dataset.vision.py_transforms.CenterCrop"><code class="xref py py-obj docutils literal notranslate"><span class="pre">mindspore.dataset.vision.py_transforms.CenterCrop</span></code></a></p></td>
<td><p>以输入PIL图像的中心为裁剪中心，裁剪指定大小的子图。</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="dataset_vision/mindspore.dataset.vision.py_transforms.Cutout.html#mindspore.dataset.vision.py_transforms.Cutout" title="mindspore.dataset.vision.py_transforms.Cutout"><code class="xref py py-obj docutils literal notranslate"><span class="pre">mindspore.dataset.vision.py_transforms.Cutout</span></code></a></p></td>
<td><p>随机去除输入numpy.ndarray图像上一定数量的正方形区域，将区域内像素值置为0。</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="dataset_vision/mindspore.dataset.vision.py_transforms.Decode.html#mindspore.dataset.vision.py_transforms.Decode" title="mindspore.dataset.vision.py_transforms.Decode"><code class="xref py py-obj docutils literal notranslate"><span class="pre">mindspore.dataset.vision.py_transforms.Decode</span></code></a></p></td>
<td><p>将输入原始图像字节解码为RGB格式PIL图像。</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="dataset_vision/mindspore.dataset.vision.py_transforms.Equalize.html#mindspore.dataset.vision.py_transforms.Equalize" title="mindspore.dataset.vision.py_transforms.Equalize"><code class="xref py py-obj docutils literal notranslate"><span class="pre">mindspore.dataset.vision.py_transforms.Equalize</span></code></a></p></td>
<td><p>均衡输入PIL图像的直方图。</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="dataset_vision/mindspore.dataset.vision.py_transforms.FiveCrop.html#mindspore.dataset.vision.py_transforms.FiveCrop" title="mindspore.dataset.vision.py_transforms.FiveCrop"><code class="xref py py-obj docutils literal notranslate"><span class="pre">mindspore.dataset.vision.py_transforms.FiveCrop</span></code></a></p></td>
<td><p>在输入PIL图像的中心与四个角处分别裁剪指定大小的子图。</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="dataset_vision/mindspore.dataset.vision.py_transforms.Grayscale.html#mindspore.dataset.vision.py_transforms.Grayscale" title="mindspore.dataset.vision.py_transforms.Grayscale"><code class="xref py py-obj docutils literal notranslate"><span class="pre">mindspore.dataset.vision.py_transforms.Grayscale</span></code></a></p></td>
<td><p>将输入PIL图像转换为灰度图。</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="dataset_vision/mindspore.dataset.vision.py_transforms.HsvToRgb.html#mindspore.dataset.vision.py_transforms.HsvToRgb" title="mindspore.dataset.vision.py_transforms.HsvToRgb"><code class="xref py py-obj docutils literal notranslate"><span class="pre">mindspore.dataset.vision.py_transforms.HsvToRgb</span></code></a></p></td>
<td><p>将输入的HSV格式numpy.ndarray图像转换为RGB格式。</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="dataset_vision/mindspore.dataset.vision.py_transforms.HWC2CHW.html#mindspore.dataset.vision.py_transforms.HWC2CHW" title="mindspore.dataset.vision.py_transforms.HWC2CHW"><code class="xref py py-obj docutils literal notranslate"><span class="pre">mindspore.dataset.vision.py_transforms.HWC2CHW</span></code></a></p></td>
<td><p>将输入的(H, W, C)形状numpy.ndarray图像转换为(C, H, W)形状。</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="dataset_vision/mindspore.dataset.vision.py_transforms.Invert.html#mindspore.dataset.vision.py_transforms.Invert" title="mindspore.dataset.vision.py_transforms.Invert"><code class="xref py py-obj docutils literal notranslate"><span class="pre">mindspore.dataset.vision.py_transforms.Invert</span></code></a></p></td>
<td><p>反转输入PIL图像的颜色。</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="dataset_vision/mindspore.dataset.vision.py_transforms.LinearTransformation.html#mindspore.dataset.vision.py_transforms.LinearTransformation" title="mindspore.dataset.vision.py_transforms.LinearTransformation"><code class="xref py py-obj docutils literal notranslate"><span class="pre">mindspore.dataset.vision.py_transforms.LinearTransformation</span></code></a></p></td>
<td><p>使用指定的变换方阵和均值向量对输入numpy.ndarray图像进行线性变换。</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="dataset_vision/mindspore.dataset.vision.py_transforms.MixUp.html#mindspore.dataset.vision.py_transforms.MixUp" title="mindspore.dataset.vision.py_transforms.MixUp"><code class="xref py py-obj docutils literal notranslate"><span class="pre">mindspore.dataset.vision.py_transforms.MixUp</span></code></a></p></td>
<td><p>随机混合一批输入的numpy.ndarray图像及其标签。</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="dataset_vision/mindspore.dataset.vision.py_transforms.Normalize.html#mindspore.dataset.vision.py_transforms.Normalize" title="mindspore.dataset.vision.py_transforms.Normalize"><code class="xref py py-obj docutils literal notranslate"><span class="pre">mindspore.dataset.vision.py_transforms.Normalize</span></code></a></p></td>
<td><p>使用指定的均值和标准差，标准化形如(C, H, W)的输入numpy.ndarray图像。</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="dataset_vision/mindspore.dataset.vision.py_transforms.NormalizePad.html#mindspore.dataset.vision.py_transforms.NormalizePad" title="mindspore.dataset.vision.py_transforms.NormalizePad"><code class="xref py py-obj docutils literal notranslate"><span class="pre">mindspore.dataset.vision.py_transforms.NormalizePad</span></code></a></p></td>
<td><p>使用指定的均值和标准差，标准化形如(C, H, W)的输入numpy.ndarray图像，并填充一个全零的额外通道。</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="dataset_vision/mindspore.dataset.vision.py_transforms.Pad.html#mindspore.dataset.vision.py_transforms.Pad" title="mindspore.dataset.vision.py_transforms.Pad"><code class="xref py py-obj docutils literal notranslate"><span class="pre">mindspore.dataset.vision.py_transforms.Pad</span></code></a></p></td>
<td><p>对输入PIL图像的各边进行填充。</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="dataset_vision/mindspore.dataset.vision.py_transforms.RandomAffine.html#mindspore.dataset.vision.py_transforms.RandomAffine" title="mindspore.dataset.vision.py_transforms.RandomAffine"><code class="xref py py-obj docutils literal notranslate"><span class="pre">mindspore.dataset.vision.py_transforms.RandomAffine</span></code></a></p></td>
<td><p>对输入PIL图像进行随机仿射变换。</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="dataset_vision/mindspore.dataset.vision.py_transforms.RandomColor.html#mindspore.dataset.vision.py_transforms.RandomColor" title="mindspore.dataset.vision.py_transforms.RandomColor"><code class="xref py py-obj docutils literal notranslate"><span class="pre">mindspore.dataset.vision.py_transforms.RandomColor</span></code></a></p></td>
<td><p>随机调整输入PIL图像的色彩平衡。</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="dataset_vision/mindspore.dataset.vision.py_transforms.RandomColorAdjust.html#mindspore.dataset.vision.py_transforms.RandomColorAdjust" title="mindspore.dataset.vision.py_transforms.RandomColorAdjust"><code class="xref py py-obj docutils literal notranslate"><span class="pre">mindspore.dataset.vision.py_transforms.RandomColorAdjust</span></code></a></p></td>
<td><p>随机调整输入PIL图像的亮度、对比度、饱和度和色调。</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="dataset_vision/mindspore.dataset.vision.py_transforms.RandomCrop.html#mindspore.dataset.vision.py_transforms.RandomCrop" title="mindspore.dataset.vision.py_transforms.RandomCrop"><code class="xref py py-obj docutils literal notranslate"><span class="pre">mindspore.dataset.vision.py_transforms.RandomCrop</span></code></a></p></td>
<td><p>在输入PIL图像上的随机位置，裁剪指定大小的子图。</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="dataset_vision/mindspore.dataset.vision.py_transforms.RandomErasing.html#mindspore.dataset.vision.py_transforms.RandomErasing" title="mindspore.dataset.vision.py_transforms.RandomErasing"><code class="xref py py-obj docutils literal notranslate"><span class="pre">mindspore.dataset.vision.py_transforms.RandomErasing</span></code></a></p></td>
<td><p>按照指定的概率擦除输入numpy.ndarray图像上随机矩形区域内的像素。</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="dataset_vision/mindspore.dataset.vision.py_transforms.RandomGrayscale.html#mindspore.dataset.vision.py_transforms.RandomGrayscale" title="mindspore.dataset.vision.py_transforms.RandomGrayscale"><code class="xref py py-obj docutils literal notranslate"><span class="pre">mindspore.dataset.vision.py_transforms.RandomGrayscale</span></code></a></p></td>
<td><p>按照指定的概率将输入PIL图像转换为灰度图。</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="dataset_vision/mindspore.dataset.vision.py_transforms.RandomHorizontalFlip.html#mindspore.dataset.vision.py_transforms.RandomHorizontalFlip" title="mindspore.dataset.vision.py_transforms.RandomHorizontalFlip"><code class="xref py py-obj docutils literal notranslate"><span class="pre">mindspore.dataset.vision.py_transforms.RandomHorizontalFlip</span></code></a></p></td>
<td><p>按照指定的概率随机水平翻转输入的PIL图像。</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="dataset_vision/mindspore.dataset.vision.py_transforms.RandomPerspective.html#mindspore.dataset.vision.py_transforms.RandomPerspective" title="mindspore.dataset.vision.py_transforms.RandomPerspective"><code class="xref py py-obj docutils literal notranslate"><span class="pre">mindspore.dataset.vision.py_transforms.RandomPerspective</span></code></a></p></td>
<td><p>按照指定的概率对输入PIL图像进行透视变换。</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="dataset_vision/mindspore.dataset.vision.py_transforms.RandomResizedCrop.html#mindspore.dataset.vision.py_transforms.RandomResizedCrop" title="mindspore.dataset.vision.py_transforms.RandomResizedCrop"><code class="xref py py-obj docutils literal notranslate"><span class="pre">mindspore.dataset.vision.py_transforms.RandomResizedCrop</span></code></a></p></td>
<td><p>在输入PIL图像上的随机位置裁剪子图，并放缩到指定大小。</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="dataset_vision/mindspore.dataset.vision.py_transforms.RandomRotation.html#mindspore.dataset.vision.py_transforms.RandomRotation" title="mindspore.dataset.vision.py_transforms.RandomRotation"><code class="xref py py-obj docutils literal notranslate"><span class="pre">mindspore.dataset.vision.py_transforms.RandomRotation</span></code></a></p></td>
<td><p>将输入PIL图像旋转随机角度。</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="dataset_vision/mindspore.dataset.vision.py_transforms.RandomSharpness.html#mindspore.dataset.vision.py_transforms.RandomSharpness" title="mindspore.dataset.vision.py_transforms.RandomSharpness"><code class="xref py py-obj docutils literal notranslate"><span class="pre">mindspore.dataset.vision.py_transforms.RandomSharpness</span></code></a></p></td>
<td><p>随机调整输入PIL图像的锐度。</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="dataset_vision/mindspore.dataset.vision.py_transforms.RandomVerticalFlip.html#mindspore.dataset.vision.py_transforms.RandomVerticalFlip" title="mindspore.dataset.vision.py_transforms.RandomVerticalFlip"><code class="xref py py-obj docutils literal notranslate"><span class="pre">mindspore.dataset.vision.py_transforms.RandomVerticalFlip</span></code></a></p></td>
<td><p>按照指定的概率随机垂直翻转输入的PIL图像。</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="dataset_vision/mindspore.dataset.vision.py_transforms.Resize.html#mindspore.dataset.vision.py_transforms.Resize" title="mindspore.dataset.vision.py_transforms.Resize"><code class="xref py py-obj docutils literal notranslate"><span class="pre">mindspore.dataset.vision.py_transforms.Resize</span></code></a></p></td>
<td><p>将输入PIL图像放缩为指定大小。</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="dataset_vision/mindspore.dataset.vision.py_transforms.RgbToHsv.html#mindspore.dataset.vision.py_transforms.RgbToHsv" title="mindspore.dataset.vision.py_transforms.RgbToHsv"><code class="xref py py-obj docutils literal notranslate"><span class="pre">mindspore.dataset.vision.py_transforms.RgbToHsv</span></code></a></p></td>
<td><p>将输入的RGB格式numpy.ndarray图像转换为HSV格式。</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="dataset_vision/mindspore.dataset.vision.py_transforms.TenCrop.html#mindspore.dataset.vision.py_transforms.TenCrop" title="mindspore.dataset.vision.py_transforms.TenCrop"><code class="xref py py-obj docutils literal notranslate"><span class="pre">mindspore.dataset.vision.py_transforms.TenCrop</span></code></a></p></td>
<td><p>在输入PIL图像的中心与四个角处分别裁剪指定大小的子图，并将其翻转图一并返回。</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="dataset_vision/mindspore.dataset.vision.py_transforms.ToPIL.html#mindspore.dataset.vision.py_transforms.ToPIL" title="mindspore.dataset.vision.py_transforms.ToPIL"><code class="xref py py-obj docutils literal notranslate"><span class="pre">mindspore.dataset.vision.py_transforms.ToPIL</span></code></a></p></td>
<td><p>将已解码的numpy.ndarray图像转换为PIL图像。</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="dataset_vision/mindspore.dataset.vision.py_transforms.ToTensor.html#mindspore.dataset.vision.py_transforms.ToTensor" title="mindspore.dataset.vision.py_transforms.ToTensor"><code class="xref py py-obj docutils literal notranslate"><span class="pre">mindspore.dataset.vision.py_transforms.ToTensor</span></code></a></p></td>
<td><p>将输入的PIL或numpy.ndarray图像转换为指定数据类型的numpy.ndarray图像，此时像素值取值将由[0, 255]变为[0.0, 1.0]，图像的shape将由(H, W, C)变为(C, H, W)。</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="dataset_vision/mindspore.dataset.vision.py_transforms.ToType.html#mindspore.dataset.vision.py_transforms.ToType" title="mindspore.dataset.vision.py_transforms.ToType"><code class="xref py py-obj docutils literal notranslate"><span class="pre">mindspore.dataset.vision.py_transforms.ToType</span></code></a></p></td>
<td><p>将输入的numpy.ndarray图像转换为指定数据类型。</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="dataset_vision/mindspore.dataset.vision.py_transforms.UniformAugment.html#mindspore.dataset.vision.py_transforms.UniformAugment" title="mindspore.dataset.vision.py_transforms.UniformAugment"><code class="xref py py-obj docutils literal notranslate"><span class="pre">mindspore.dataset.vision.py_transforms.UniformAugment</span></code></a></p></td>
<td><p>从指定序列中均匀采样一批数据处理操作，并按顺序随机执行，即采样出的操作也可能不被执行。</p></td>
</tr>
</tbody>
</table>
</div>
<div class="section" id="mindspore-dataset-vision-utils">
<h2>mindspore.dataset.vision.utils<a class="headerlink" href="#mindspore-dataset-vision-utils" title="Permalink to this headline">¶</a></h2>
<table class="longtable docutils align-default">
<colgroup>
<col style="width: 10%" />
<col style="width: 90%" />
</colgroup>
<tbody>
<tr class="row-odd"></tr>
<tr class="row-even"><td><p><a class="reference internal" href="dataset_vision/mindspore.dataset.vision.Border.html#mindspore.dataset.vision.Border" title="mindspore.dataset.vision.Border"><code class="xref py py-obj docutils literal notranslate"><span class="pre">mindspore.dataset.vision.Border</span></code></a></p></td>
<td><p>边界填充方式枚举类。</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="dataset_vision/mindspore.dataset.vision.ConvertMode.html#mindspore.dataset.vision.ConvertMode" title="mindspore.dataset.vision.ConvertMode"><code class="xref py py-obj docutils literal notranslate"><span class="pre">mindspore.dataset.vision.ConvertMode</span></code></a></p></td>
<td><p>图像色彩空间转换模式枚举类。</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="dataset_vision/mindspore.dataset.vision.ImageBatchFormat.html#mindspore.dataset.vision.ImageBatchFormat" title="mindspore.dataset.vision.ImageBatchFormat"><code class="xref py py-obj docutils literal notranslate"><span class="pre">mindspore.dataset.vision.ImageBatchFormat</span></code></a></p></td>
<td><p>图像批处理输出格式枚举类。</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="dataset_vision/mindspore.dataset.vision.Inter.html#mindspore.dataset.vision.Inter" title="mindspore.dataset.vision.Inter"><code class="xref py py-obj docutils literal notranslate"><span class="pre">mindspore.dataset.vision.Inter</span></code></a></p></td>
<td><p>图像插值方式枚举类。</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="dataset_vision/mindspore.dataset.vision.SliceMode.html#mindspore.dataset.vision.SliceMode" title="mindspore.dataset.vision.SliceMode"><code class="xref py py-obj docutils literal notranslate"><span class="pre">mindspore.dataset.vision.SliceMode</span></code></a></p></td>
<td><p>Tensor切片方式枚举类。</p></td>
</tr>
</tbody>
</table>
</div>
</div>


           </div>
           
          </div>
          <footer>
    <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
        <a href="dataset_vision/mindspore.dataset.vision.c_transforms.AutoContrast.html" class="btn btn-neutral float-right" title="mindspore.dataset.vision.c_transforms.AutoContrast" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
        <a href="dataset_transforms/mindspore.dataset.transforms.py_transforms.RandomOrder.html" class="btn btn-neutral float-left" title="mindspore.dataset.transforms.py_transforms.RandomOrder" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
    </div>

  <hr/>

  <div role="contentinfo">
    <p>
        &#169; Copyright 2021, MindSpore.

    </p>
  </div>
    
    
    
    Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
    
    <a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
    
    provided by <a href="https://readthedocs.org">Read the Docs</a>. 

</footer>
        </div>
      </div>

    </section>

  </div>
  

  <script type="text/javascript">
      jQuery(function () {
          SphinxRtdTheme.Navigation.enable(true);
      });
  </script>

  
  
    
   

</body>
</html>